package com.example.jiubodou.domain;

import com.example.jiubodou.validation.Mobile;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;

/**
 * @ClassName Sudent
 * @Description
 * @Author huyingliang
 * @Date 2024-05-06 14:39
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class Student {
    @NotBlank(message = "名字不能为空")
    private String name;

    @DecimalMax(value = "150", message = "年龄不能大于150，除非您是神仙")
    @DecimalMin(value = "0", message = "年龄不能小于0，除非您还没出生")
    private Integer age;

    @Mobile
    private String mobile;
}
